package lt.inkredibl.iit;

import java.io.File;
import java.lang.ref.WeakReference;

import javax.swing.JFileChooser;

public class FileChooserSource
{
	private static WeakReference<FileChooserSource> _ref;

	public static FileChooserSource inst()
	{
		if (_ref == null || _ref.get() == null)
		{
			_ref = new WeakReference<FileChooserSource>(new FileChooserSource());
		}
		return _ref.get();
	}

	public JFileChooser getFileChooser()
	{
		JFileChooser fc;
		fc = new JFileChooser();
		fc.setAcceptAllFileFilterUsed(true);
		fc.setCurrentDirectory(new File("."));
		fc.setMultiSelectionEnabled(false);
		return fc;
	}
}
